import request from "@/utils/request";

// 查询应收账款列表
export function listErpAccountsReceivable(query) {
  return request({
    url: "/erp/ErpAccountsReceivable/list",
    method: "get",
    params: query,
  });
}

// 查询应收账款详细
export function getErpAccountsReceivable(receivableId) {
  return request({
    url: "/erp/ErpAccountsReceivable/" + receivableId,
    method: "get",
  });
}

// 新增应收账款
export function addErpAccountsReceivable(data) {
  return request({
    url: "/erp/ErpAccountsReceivable",
    method: "post",
    data: data,
  });
}

// 修改应收账款
export function updateErpAccountsReceivable(data) {
  return request({
    url: "/erp/ErpAccountsReceivable",
    method: "put",
    data: data,
  });
}

// 删除应收账款
export function delErpAccountsReceivable(receivableId) {
  return request({
    url: "/erp/ErpAccountsReceivable/" + receivableId,
    method: "delete",
  });
}

// 应付账款收款
export function receivingPaymentErpAccountsReceivable(data) {
  return request({
    url: "/erp/ErpAccountsReceivable/receivingPayments",
    method: "put",
    data: data,
  });
}

// 应付账款开票
export function invoicingErpAccountsReceivable(data) {
  return request({
    url: "/erp/ErpAccountsReceivable/invoicing",
    method: "put",
    data: data,
  });
}

// 查询应收账款顶部统计
export function getStatistics() {
  return request({
    url: "/erp/ErpAccountsReceivable/statistics",
    method: "get",
  });
}
